
import {TOPIC_LOADING,TOPIC_LOADOVER} from '../constant'
const init = {loading:true,data:[]}
export default (pre = init,action) => {
const {type,data} = action
switch(type){
    case TOPIC_LOADING:
        return {
            loading:true,
            data:[]
        }
    case TOPIC_LOADOVER:
        return {
            loading:false,
            data:data
        }
    default:
        return pre
}
}